package com.ruoyi.inspection.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.inspection.domain.FzInspectionRoute;
import com.ruoyi.inspection.mapper.FzInspectionRouteMapper;
import com.ruoyi.inspection.service.IFzInspectionRouteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.core.text.Convert;

/**
 * 路线Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-03-13
 */
@Service
public class FzInspectionRouteServiceImpl implements IFzInspectionRouteService
{
    @Autowired
    private FzInspectionRouteMapper fzInspectionRouteMapper;

    /**
     * 查询路线
     * 
     * @param routeId 路线ID
     * @return 路线
     */
    @Override
    public FzInspectionRoute selectFzInspectionRouteById(String routeId)
    {
        return fzInspectionRouteMapper.selectFzInspectionRouteById(routeId);
    }

    /**
     * 查询路线列表
     * 
     * @param fzInspectionRoute 路线
     * @return 路线
     */
    @Override
    public List<FzInspectionRoute> selectFzInspectionRouteList(FzInspectionRoute fzInspectionRoute)
    {
        return fzInspectionRouteMapper.selectFzInspectionRouteList(fzInspectionRoute);
    }

    /**
     * 新增路线
     * 
     * @param fzInspectionRoute 路线
     * @return 结果
     */
    @Override
    public int insertFzInspectionRoute(FzInspectionRoute fzInspectionRoute)
    {
        fzInspectionRoute.setCreateTime(DateUtils.getNowDate());
        return fzInspectionRouteMapper.insertFzInspectionRoute(fzInspectionRoute);
    }

    /**
     * 修改路线
     * 
     * @param fzInspectionRoute 路线
     * @return 结果
     */
    @Override
    public int updateFzInspectionRoute(FzInspectionRoute fzInspectionRoute)
    {
        fzInspectionRoute.setUpdateTime(DateUtils.getNowDate());
        return fzInspectionRouteMapper.updateFzInspectionRoute(fzInspectionRoute);
    }

    /**
     * 删除路线对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteFzInspectionRouteByIds(String ids)
    {
        return fzInspectionRouteMapper.deleteFzInspectionRouteByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除路线信息
     * 
     * @param routeId 路线ID
     * @return 结果
     */
    @Override
    public int deleteFzInspectionRouteById(String routeId)
    {
        return fzInspectionRouteMapper.deleteFzInspectionRouteById(routeId);
    }
}
